import React,{PureComponent} from 'react';
import {connect} from 'react-redux';
import {ListA,ListWrapperB} from '../style';
import { Icon} from 'antd';
import {NavLink} from "react-router-dom";
import teacher from '../../../icon/教师.png';


class TeacherShow extends PureComponent {

    render(){
        const data={
            teachers:this.props.teachers.toJS(),
            bar:this.props.bar.toJS()
        };
        const teacherBar=data.bar[2];
        return(

       <ListA style={{ height:"330px"}}>
                    <div style={{width:'100%',height:'60px'}}> <h1 className='title'><img style={{width:'43px',height:'38px',padding:'0 10px 5px 0'}} alt=''  src={teacher}/>教师风采</h1><NavLink className='more' to={{pathname: '/ListPage', state: {url:'/getData?tbName=MienScientific&&category=教师风采',bar:teacherBar}}}>more<Icon type="caret-right" style={{fontSize:'20px'}} /></NavLink></div>
                    <ListWrapperB onClick={()=>{window.open(window.barIp+data.teachers[0].path+'?tbName=MienScientific&&category=教师风采&&id='+data.teachers[0].id)}} style={{padding:'20px 0 20px 20px '}}><img src={data.teachers[0].imageUrl} alt=''  style={{width:'60%',height:'100%',float:'left'}} /> <div className='box ' style={{float:'right'}}><h2 style={{color:'#264f7e'}}>{data.teachers[0].title}</h2><h3 style={{color:'#264f7e'}}>{data.teachers[0].content}</h3></div></ListWrapperB>
                    <ListWrapperB onClick={()=>{window.open(window.barIp+data.teachers[1].path+'?tbName=MienScientific&&category=教师风采&&id='+data.teachers[1].id)}} style={{float:'right',padding:'20px 0 20px 20px '}}><img src={data.teachers[1].imageUrl} alt=''  style={{width:'60%',height:'100%',float:'left'}} /> <div className='box ' style={{float:'right'}}><h2 style={{color:'#264f7e'}}>{data.teachers[1].title}</h2><h3 style={{color:'#264f7e'}}>{data.teachers[1].content}</h3></div></ListWrapperB>
                </ListA>

        )

    }
}
const mapState=(state)=>({
    teachers:state.getIn(['home','teachers']),
    bar: state.getIn(['header','barMenu'])
});
export default connect(mapState,null)(TeacherShow);